<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include/src :: form_base_js_and_css"/>
</head>
<body style="background-color: #f2f2f2; height: 100%;">
	
	<script type="text/html" id="toolbar_in_form">
	</script>

	<div id="id_panel">
	</div>
	<script th:inline="javascript">
	
	var dto = [[${dto}]]
	dto.footer.show = 0;

	// 表单初始化
	var formObj = null;
	//使用layui的sku模块
	layui.config({
		//自定义layui组件的目录,设定扩展的layui模块的所在目录，一般用于外部模块扩展
		base: '/static/js/layui_extends/'
	}).use(['form', 'jquery', 'laydate', 'YsForm', 'YsModal'], function(){
		var $ = layui.jquery,
		form = layui.form,
		laydate = layui.laydate,
		YsForm = layui.YsForm,
		YsModal = layui.YsModal
		/* 
		* 表单初始化
		* 参数1：表单配置参数
		* 参数2：子表配置参数
		*/
		formObj = YsForm.init(
		{
			id:'id_panel', // 页面容器ID
			dto: $.parseJSON(JSON.stringify(dto)),
			callback: function() {
				
			}
		}
		);

		//重写弹出框
		formObj.showModal=function(modalKey, colCode) {
			var t = formObj;
			if(colCode == 'logsticsChannelName'){//物流方式弹框
				var cck = formObj.getValueByName("cck");//仓库
				var country = formObj.getValueByName("country");//国家
				var transportationId = formObj.getValueByName("transportationId");//运输类型
				var nameLogsticsClearance = formObj.getValueByName("nameLogsticsClearance");//清关方式
				layui.YsModal.init({modalKey: modalKey, colCode: colCode, parentObj: t, extraData:{}, conditionsDefault: [], sameCode: 'xx'
					,pathGridRequest: '/api/inter/tccLogisticsChannelMaint/searchPlan?cck='+cck
							+ '&country=' + country
							+'&transportationId=' + transportationId
							+'&nameLogsticsClearance=' + nameLogsticsClearance});

			} else{
				// 打开单选框,
				layui.YsModal.init({modalKey: modalKey, colCode: colCode, parentObj: t, extraData:{}, conditionsDefault: [{code: 'aaa', value:'123'},{code: 'bbb', value:'456'}], sameCode: 'xx'});
			}
		}
	});
	</script>
</body>
</html>
